#道长
"""d """
"""
测试失败后要重新运行n次，要在重新运行之间添加延迟时间，间隔n秒再运行。
安装：pip install pytest-rerunfailures

第一种：    # pytest.main(["--reruns=3","--reruns-delay=2",__file__])
第二种：@pytest.mark.flaky(reruns=3,reruns_delay=2)
第三种：pytest -v --reruns 3 --reruns-delay 2 test777.py
"""
# pytest -v --reruns 3 --reruns-delay 2   每次等待2秒重试3次
import pytest
def test_a():
    assert (1,2,3) == (1,2,3)


@pytest.mark.flaky(reruns=3,reruns_delay=2)
def test_failing():
    assert (1,2,3) == (4,5,6)

if __name__ == '__main__':
    # pytest.main(["--reruns=3","--reruns-delay=2",__file__])
    pytest.main([__file__])